Encapsulate source paths more - #26795
Open
SolalPirelli wants to merge 4 commits into
Open
Conversation
SolalPirelli
commented
Aug 13, 2026
| val javaextdirs: Setting[String] = PathSetting(RootSetting, "javaextdirs", "Override java extdirs classpath.", Defaults.javaExtDirs, aliases = List("--java-extension-directories")) | ||
| val sourcepath: Setting[String] = PathSetting(RootSetting, "sourcepath", "Specify location(s) of source files.", Defaults.scalaSourcePath, aliases = List("--source-path")) | ||
| val sourceroot: Setting[String] = PathSetting(RootSetting, "sourceroot", "Specify workspace root directory.", ".") | ||
| val sourceroot: Setting[AbstractFile] = FileContainerSetting(RootSetting, "sourceroot", allowsJar = false, "Specify workspace root directory.", new PlainDirectory(Directory("."))) |
Contributor
Author
There was a problem hiding this comment.
Since I wanted to reuse the "setting for an AbstractFile", it had to be renamed as this isn't an output. (Better name suggestion than FileContainer for "thing that can contain files, like a directory or a JAR", welcome, though)
SolalPirelli
commented
Aug 13, 2026
| val isJar = path.ext.isJar | ||
| if !isJar && !path.isDirectory then | ||
| state.fail(s"'$arg' does not exist or is not a directory or .jar file", args) | ||
| state.fail(s"'$arg' does not exist or is not a " + helpArg, args) |
Contributor
Author
There was a problem hiding this comment.
only logic change of the settings part -- now if it's just a dir we don't say "directory or .jar file", just "directory"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SourceFileso the setting value doesn't need to be passed aroundHave you relied on LLM-based tools in this contribution?
No
How was the solution tested?
Covered by existing tests (this is a refactoring)